package com.TestDemo.Test202203To04;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/05/12/8:59
 * @Description:
 * @Target:
 */
public class 最大公约数 {

    public static void main(String[] args) {
        System.out.println(gcd(11,22));
    }


    public static int gcd(int q,int p){
        if (p == 0){
            return q;
        }

        int r = q % p ;
        return gcd(p,r);
    }
}
